﻿/*
    Copyright 2014 Mahesh Khanwalkar

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 */

using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Documents;

namespace AudioDocs
{
    /// <summary>
    /// Interaction logic for About.xaml
    /// </summary>
    public partial class About
    {
        public About()
        {
            InitializeComponent();
        }

        private void About_OnLoaded(object sender, RoutedEventArgs e)
        {
            var licenseLink = new Hyperlink
            {
                NavigateUri = new Uri("http://opensource.org/licenses/ms-pl")
            };

            var nAudioLink = new Hyperlink
            {
                NavigateUri = new Uri("http://naudio.codeplex.com/")
            };

            var docXLink = new Hyperlink
            {
                NavigateUri = new Uri("http://docx.codeplex.com/")
            };
            

            licenseLink.Inlines.Add("Microsoft Public License");
            licenseLink.RequestNavigate += (o, args) => Process.Start(args.Uri.ToString());

            nAudioLink.Inlines.Add("NAudio");
            nAudioLink.RequestNavigate += (o, args) => Process.Start(args.Uri.ToString());

            docXLink.Inlines.Add("DocX");
            docXLink.RequestNavigate += (o, args) => Process.Start(args.Uri.ToString());

            AboutBlock.Inlines.Add("AudioDocs is a free Microsoft Word to Audio converter. It uses \n" +
                                   "Text-to-Speech (TTS) to convert text into audio bytes. \n\n" +
                                   "AudioDocs uses ");

            AboutBlock.Inlines.Add(nAudioLink);
            AboutBlock.Inlines.Add(" and ");

            AboutBlock.Inlines.Add(docXLink);
            AboutBlock.Inlines.Add(" libraries which are both licensed \n" + "under the Microsoft Public License (");

            AboutBlock.Inlines.Add(licenseLink);
            AboutBlock.Inlines.Add(")\n\nAudioDocs was created by Mahesh Khanwalkar");
        }
    }
}
